<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" th:href="@{/bar.css}">
</head>
<body>
<div th:replace="commons/bar::#nav">
</div>
<table>
    <thead>
    <tr>
        <td>
            <button><a href="edit_user.html" th:href="@{/emp}">添加</a></button>
        </td>
    </tr>
    </thead>
    <tbody>
    <tr th:each="emp:${emps}">
        <td th:text="${emp.id}"></td>
        <td th:text="${emp.name}"></td>
        <td th:text="${emp.gender} == 0 ? '女' : '男'"></td>
        <td>
            <button><a th:href="@{/emp/}+${emp.id}">修改</a></button>
        </td>
        <td>
            <form th:action="@{/emp/}+${emp.id}" method="post">
                <input type="hidden" name="_method" value="DELETE">
                <button type="submit">删除</button>
            </form>
        </td>

    </tr>
    </tbody>
</table>
</body>
</html>